﻿using System.Runtime.InteropServices;

namespace Ast.Core.Pe.Definitions
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public struct NewExeFileHeader
    {
        public static readonly int NeSignature = 0x454E;

        public static readonly int PeSignature = 0x4550;

        public int Signature;

        public Machine Machine;

        public ushort NumberOfSections;

        public uint TimeDateStamp;

        public uint PointerToSymbolTable;

        public uint NumberOfSymbols;

        public ushort SizeOfOptionalHeader;

        public FileCharacteristics Characteristics;

        public bool IsValid
        {
            get { return Signature == PeSignature; }
        }
    }
}